<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ViewEdit.aspx.cs" Inherits="labDict.Web.ViewEdit" %>
<%@ MasterType TypeName="labDict.Web.Site" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" runat="server">
<asp:Panel ID="pnlViewLabTest" runat="server">
<asp:Label ID="lblErrorMessage" runat="server"></asp:Label>
<asp:Button ID="btnEditTest" OnClick="btnEditTest_Click" runat="server" Text="Edit" />
<asp:Button ID="btnNewTest" OnClick="btnNewTest_Click" runat="server" Text="New Test" />
<asp:LinkButton ID="lbHome" runat="server" Text="View All" PostBackUrl="~/Default.aspx" />
<table border="0">
  <tbody>
  <tr>
    <td colspan="3"></td></tr>
  <tr>
    <td style="background-color:#333366" colspan="3">
    <font color="#ffffff">Please review the exisiting database values below for 
      errors, inconsistent formatting, etc.<br/>If you would like to make a 
      change, but are concerned that it may affect the internal systems, please 
      email <a href="mailto:michele.henry@uhn.on.ca"><font color="#cccccc">Michele 
      Henry</font></a> before making the change.</font></td></tr>
  <tr>
    <td align="right" colspan="3" height="10">&nbsp;</td></tr>
  <tr>
    <td align="right">test name:</td>
    <td>
    <asp:TextBox ID="tb_TEST_ID" runat="server" Visible="false"></asp:TextBox>
    <asp:TextBox ID="tb_TEST" runat="server"></asp:TextBox>
    </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td align="right">(internal) container:</td>
    <td>
    <asp:DropDownList ID="ddl_CONTAINER_ID" runat="server"></asp:DropDownList>
    </td>
    <td><a 
      href="https://intranet.uhn.ca/hospitals_associates/tml/LabDictionary/admin_tool/container.asp?CONTAINER_ID=41"></a></td></tr>
  <tr>
    <td valign="center" align="right">(internal) ALTERNATE container:</td>
    <td valign="center>
    <asp:TextBox ID="tb_ALT_CONTAINER" Columns="42" Rows="4" runat="server"></asp:TextBox>
    </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td align="right">synonym1:</td>
    <td>
    <asp:TextBox ID="tb_SYNONYM1" MaxLength="32" runat="server"></asp:TextBox>
    </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td align="right">synonym2:</td>
    <td><asp:TextBox ID="tb_SYNONYM2" MaxLength="32" runat="server"></asp:TextBox>
    </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td align="right">synonym3:</td>
    <td><asp:TextBox ID="tb_SYNONYM3" MaxLength="32" runat="server"></asp:TextBox>
    </td>
    <td>&nbsp;</td></tr>
  
  <tr>
    <td style="height: 14px" colspan="3">&nbsp;</td></tr>
  <tr>
    <td align="right">price estimate:</td>
    <td colspan="2">$ <asp:TextBox ID="tb_PRICE_ESTIMATE" runat="server" />
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font 
      color="#999999"><b>to</b> (optional) $:</font> <asp:TextBox ID="tb_PRICE_UPPER" runat="server" /> </td></tr>
  <tr>
    <td align="right">testing schedule:</td>
    <td><asp:DropDownList ID="ddl_TESTING_SCHEDULE_ID" runat="server" /></td>
    <td><a 
      href="https://intranet.uhn.ca/hospitals_associates/tml/LabDictionary/admin_tool/schedule.asp?DIVISION_ID=2&amp;alpha=c&amp;TEST_ID=368&amp;Testing_Schedule_ID=13"></a></td></tr>
  <tr>
    <td align="right">secondary schedule(if necessary):</td>
    <td><asp:DropDownList ID="ddl_TESTING_SCHEDULE2_ID" runat="server" /></td>
    <td><a 
      href="https://intranet.uhn.ca/hospitals_associates/tml/LabDictionary/admin_tool/schedule.asp?DIVISION_ID=2&amp;alpha=c&amp;TEST_ID=368&amp;Testing_Schedule_ID=13"></a></td></tr>
  <tr>
    <td align="right">(web) turn-around-time:</td>
    <td><asp:DropDownList ID="ddl_WEB_TAT_ID" runat="server" />
    </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td valign="center" align="right">clinical description:</td>
    <td>
    <asp:TextBox ID="tb_CLINICAL_DESCRIPTION" Columns="42" Rows="4" runat="server" />
    </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td valign="center" align="right">references:</td>
    <td>
    <asp:TextBox ID="tb_DOCREFERENCES" Columns="42" Rows="3" runat="server" />
    </td>
    <td>&nbsp;</td></tr>
   
  <tr valign="baseline" bgcolor="#666666">
    <td valign="center" align="right" colspan="3">&nbsp;</td></tr>
  <tr>
    <td align="right">method used:</td>
    <td>
    <asp:DropDownList ID="ddl_METHOD_ID" runat="server"></asp:DropDownList>
    </td>
    <td><a 
      href="https://intranet.uhn.ca/hospitals_associates/tml/LabDictionary/admin_tool/method.asp?DIVISION_ID=2&amp;alpha=c&amp;TEST_ID=368&amp;method_ID=27"></a></td></tr>
  <tr>
    <td valign="center" align="right">special instructions:</td>
    <td>
    <asp:TextBox ID="tb_COLLECTION_INSTRUCTIONS" runat="server" Columns="48" Rows="4" />
    </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td align="right">shipping:</td>
    <td>
    <asp:DropDownList ID="ddl_SHIPPING_ID" runat="server" />
    </td>
    <td><a href="https://intranet.uhn.ca/hospitals_associates/tml/LabDictionary/admin_tool/shipping.asp?DIVISION_ID=2&amp;alpha=c&amp;TEST_ID=368&amp;Shipping_ID=7"></a></td></tr>
  <tr>
    <td align="right">
      <p>(web) recommended volume:<br><b>**important: numeric only - use 'unit 
      of measure' menu below to specify unit**</b> </p></td>
    <td>
    <asp:TextBox MaxLength="12" ID="tb_WEBVOLUME_REC" runat="server" />
    </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td align="right">(web) required volume:<br><b>**important: numeric only - 
      use 'unit of measure' menu below to specify unit**</b> </td>
    <td><asp:TextBox MaxLength="12" ID="tb_WEBVOLUME_REQ" runat="server" /></td>
    <td>&nbsp;</td></tr>
  <tr>
    <td align="right">volume measure:</td>
    <td>
    <asp:DropDownList ID="ddl_INTERNATIONAL_UNIT_ID" runat="server" />
    </td>
    <td><a 
      href="https://intranet.uhn.ca/hospitals_associates/tml/LabDictionary/admin_tool/unitmeasure.asp?DIVISION_ID=2&amp;alpha=c&amp;TEST_ID=368&amp;International_unit_ID=1"></a></td></tr>
  <tr>
    <td align="right">(web) specimen type:</td>
    <td>
    <asp:DropDownList ID="ddl_SPECIMEN_TYPE_ID" runat="server" />
    </td>
    <td><a 
      href="https://intranet.uhn.ca/hospitals_associates/tml/LabDictionary/admin_tool/webspecimen.asp?DIVISION_ID=2&amp;alpha=c&amp;TEST_ID=368&amp;Specimen_Type_ID=7"></a></td></tr>
  <tr>
    <td align="right">LIS code:</td>
    <td>
    <asp:TextBox ID="tb_LIS_CODE" MaxLength="12" runat="server"></asp:TextBox>
    </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td align="right">LOINC code:</td>
    <td><asp:TextBox ID="tb_LOINC_CODE" MaxLength="12" runat="server"></asp:TextBox></td>
    <td>&nbsp;</td></tr>
  <tr>
    <td align="right">Display on web site:</td>
    <td>
    <asp:DropDownList ID="ddl_WEBDISPLAY" runat="server" />
    </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td align="right">(web) disclaimer:</td>
    <td>
    <asp:DropDownList ID="ddl_WEBDISCLAIMER_ID" runat="server" />
    </td>
    <td><a 
      onclick="MM_popupMsg('If you require a new disclaimer type or think an exisitng one should be changed, please contact Michele Henry.')" 
      href="javascript:;"></a></td></tr>
  <tr>
    <td valign="baseline" align="right">test components:<br><b>**important: 
      separate component tests with commas (testX,testY)**</b> </td>
    <td>
    <asp:TextBox ID="tb_COMPONENTS" Columns="48" Rows="4" runat="server" ></asp:TextBox>
    </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td align="right" height="5">&nbsp;</td>
    <td align="right" height="5">
     </td>
    <td align="right" height=5>&nbsp;</td></tr>
  <tr>
    <td align="right" colspan="3">&nbsp;</td></tr><!--Everything below are the'original' database fields - the user can alter info, but is discouraged from doing so; these form items are perhaps obsolete when/if the admin tools merge, and if only one person is responsible for data entry - they can use Sheila's admin tool for these fields -->
  <tr valign="baseline" align="middle">
    <td style="background-color:#333366" colspan="3"><font 
      color=#ffffff>The database values below are used internally.<br>Please use 
      <b>extreme caution</b> when changing these fields.</font></td></tr>
  <tr>
    <td align="right" colspan="3">&nbsp;</td></tr>
  <tr>
    <td align="right">display on intranet:</td>
    <td>
    <asp:DropDownList ID="ddl_DISPLAYINTERNAL" runat="server" ></asp:DropDownList>
    </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td align="right">(internal) grant price:</td>
    <td colspan="2">$ 
    <asp:TextBox ID="tb_GRANTPRICE" MaxLength="10" runat="server"></asp:TextBox>
    </td></tr>
  <tr>
    <td align="right">critical value:</td>
    <td>
    <asp:TextBox ID="tb_CRITICAL_VALUE" MaxLength="32" runat="server"></asp:TextBox>
    </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td align="right">instrument:</td>
    <td>
    <asp:TextBox ID="tb_INSTRUMENT" MaxLength="32" runat="server"></asp:TextBox>
    </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td align="right">(internal) specimen type:</td>
    <td>
    <asp:DropDownList ID="ddl_SPEC_TYPE_ID" runat="server"></asp:DropDownList>
    </td>
    <td><a 
      href="https://intranet.uhn.ca/hospitals_associates/tml/LabDictionary/admin_tool/specimentype.asp?SPEC_TYPE_ID=6"></a></td></tr>
  <tr>
    <td align="right">(internal) submit specimen:</td>
    <td>
    <asp:TextBox ID="tb_SUBMIT_SPEC" MaxLength="32" runat="server"></asp:TextBox>
    </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td align="right">(internal) patient preparation</td>
    <td>
    <asp:TextBox ID="tb_PATIENT_PREP" MaxLength="32" runat="server"></asp:TextBox>
    </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td align="right">(internal) minimum volume (at ward):</td>
    <td>
    <asp:TextBox ID="tb_MIN_VOL_WARD" MaxLength="32" runat="server"></asp:TextBox>
    </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td align="right">(internal) minimum volume (at lab):</td>
    <td>
    <asp:TextBox ID="tb_MIN_VOL_LAB" MaxLength="32" runat="server"></asp:TextBox>
    </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td align="right">(internal) store temp (pre):</td>
    <td>
    <asp:TextBox ID="tb_STORE_TEMP_PRE" Columns="32" MaxLength="255" runat="server"></asp:TextBox>
    </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td align="right">(internal) store temp (post):</td>
    <td>
    <asp:TextBox ID="tb_STORE_TEMP_POST" Columns="32" MaxLength="255" runat="server"></asp:TextBox>
    </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td align="right">(internal) reference range:</td>
    <td>
    <asp:TextBox ID="tb_REF_RANGE" Columns="32" MaxLength="4000" runat="server"></asp:TextBox>
    </td>
    <td><a 
      onclick="MM_popupMsg('Multiple reference ranges are separated by a system of colons &amp; semi-colons. Please contact Michele Henry if you are uncertain how to format this field.')" 
      href="javascript:;"></a></td></tr>
  <tr>
    <td align="right">(internal) reference out:</td>
    <td>
    <asp:TextBox ID="tb_REF_OUT" Columns="32" MaxLength="255" runat="server"></asp:TextBox>
    </td>
    <td><a 
      onclick="MM_popupMsg('Multiple reference ranges are separated by a system of colons &amp; semi-colons. Please contact Michele Henry if you are uncertain how to format this field.')" 
      href="javascript:;"></a></td></tr>
  <tr>
    <td align="right">(internal) special handling:</td>
    <td>
    <asp:TextBox ID="tb_SPEC_HAND" Columns="32" MaxLength="4000" runat="server"></asp:TextBox>
    </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td align="right">(internal) turn-around-time:</td>
    <td>
    <asp:TextBox ID="tb_TAT_STAT" Columns="32" MaxLength="500" runat="server"></asp:TextBox>
    </td>
    <td><a 
      onclick="MM_popupMsg('Please separate multiple turn around times with semi-colons (;).')" 
      href="javascript:;"></a></td></tr>
  <tr>
    <td align="right">(internal) division:</td>
    <td>
    <asp:DropDownList ID="ddl_DIVISION_ID" runat="server"></asp:DropDownList>
    </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td align="right">(internal) functional area:</td>
    <td>
    <asp:DropDownList ID="ddl_FUNC_AREA_ID" runat="server"></asp:DropDownList>
    </td>
    <td><a 
      href="https://intranet.uhn.ca/hospitals_associates/tml/LabDictionary/admin_tool/functionalarea.asp?FUNC_AREA_ID=16"></a></td></tr>
  <tr>
    <td align="right">(internal) Ulticare requisition:</td>
    <td>
    <asp:DropDownList ID="ddl_ULT_REQ_ID" runat="server"></asp:DropDownList>
    </td>
    <td><a 
      href="https://intranet.uhn.ca/hospitals_associates/tml/LabDictionary/admin_tool/ulticarereq.asp?ULT_REQ_ID=42"></a></td></tr>
  <tr>
    <td align="right">(internal) downtime requisition:</td>
    <td>
    <asp:DropDownList ID="ddl_DOWN_REQ_ID" runat="server"></asp:DropDownList>
    </td>
    <td><a 
      href="https://intranet.uhn.ca/hospitals_associates/tml/LabDictionary/admin_tool/downtimereq.asp?DOWN_REQ_ID=6"></a></td></tr>
  <tr>
    <td align="right">(internal) information call#:</td>
    <td>
    <asp:TextBox ID="tb_INFO_CALL" Columns="32" MaxLength="255" runat="server"></asp:TextBox>
    </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td align="right" height="35">&nbsp;</td>
    <td valign="center" height="35">
    <asp:Button ID="btnEnter" onclick="cmdSubmit_Click" runat="server" Text="Submit" />
    </td>
    <td>&nbsp;</td></tr>
  <!--reference ranges for web - these are friendlier & simpler than the 'real' reference ranges elsewhere in the database. If the ranges are too complex, the user can add a standardized disclaimer -->
  <tr valign="center" align="middle" bgcolor="#666666">
    <td colspan="3>
      <p><font color="#ffffff">Reference Ranges:<br>please enter a reference range 
      <I>summary</I> for web customers in the following format:<br><b>0.24 - 
      0.70 g/L</b><br>If there are two ranges (e.g. 'male' &amp; 'female') 
      separate them with a RETURN.<br><b>male: 0.24 - 0.70 g/L<br>female: 0.28 - 
      0.80 g/L</b><br>If there are more than two ranges (e.g. multiple age &amp; 
      gender categories), please use the menu to add a complex range 
      disclaimer.</font></p></td></tr>
  <tr valign="center" align="middle" bgcolor="#666666">
    <td>&nbsp;</td>
    <td align="left">
    <SELECT onchange="updateTextField()" name="disclaimers"> 
        <OPTION selected>**select a complex range disclaimer**</OPTION> <OPTION 
        value="Reference ranges for this test are not available online. However, they are included in all test results. For more information, please call us.">Reference 
        ranges for this test are not available online...</OPTION> 
        <OPTION>**clear reference ranges field**</OPTION></SELECT> </td>
    <td>&nbsp;</td></tr>
  <tr>
    <td valign="center" align="right" bgcolor="#cccccc">(web) reference ranges:</td>
    <td valign="center" align="left" bgcolor="#cccccc">
    <asp:TextBox ID="tb_WEB_REF_RANGE" Columns="42" Rows="3" runat="server" />
    </td>
    <td valign="center" align="right" bgcolor="#cccccc">&nbsp;</td></tr>
  <tr valign="baseline" align="middle" bgcolor="#666666"><!--this reveals the 'real' reference ranges, so that the user has an idea what to enter for the 'web' reference ranges -->
    <td valign="center" colspan="3"><font color="#ffffff">The reference ranges used 
      internally are included below as reference (although special formatting is 
      used).</font></td></tr>
  <tr valign="baseline" bgcolor="#cccccc">
    <td valign="center" align="right">(internal) reference ranges:</td>
    <td valign="center" align="left"><br>
      <script language="javascript">
var strRange1='';
var strRange2='';
var strRange3='';
var strRange4='';
var strRange='Hb;140-180;g/L;M;;Hb;120-160;g/L;F|Lkc;4.0-11.0;E+9/L;;;;;;|Plt;150-400;E+9/L;;;;;;|MCV;80-95;fL;;;;;;|RDW;11.5-14.8;;;;;;;|ERC;4.5-6.5;E+12/L;M;;ERC;3.9-5.6;E+12/L;F|PCV;0.40-0.54;L/L;M;;PCV;0.33-0.47;L/L;F|MCH;27.0-32.0;pg;;;;;;|MCHC;320-360;L/L;;;;;;|NEUT;2.0-7.5;E+9/L;;;;;;|LYMPH;1.5-4.0;E+9/L;;;;;;|MONO;0.2-0.8;E+9/L;;;;;;|EOS;0.04-.4;E+9/L;;;;;;|BASO;0.01-0.1;E+9/L;;;;;;'
var semi=';'
array1=strRange.split(semi)
for (var x=0;x<(array1.length);x++){
strRange1= strRange1 + array1[x] + '</small></span></td><td><span class=instruction><small>'
}
var colon=':'
array2=strRange1.split(colon)
for (var x=0;x<(array2.length);x++){
strRange2=strRange2 + array2[x] + '</small></span></td><td colspan="3><span class=instruction><small>'
}
var bar='|'
array3=strRange2.split(bar)
for (var x=0;x<array3.length;x++){
strRange3= strRange3 + array3[x] + '</small></span></td></tr><tr><td><span class=instruction><small>'
}
var comma=','
array4=strRange3.split(comma)
for (var x=0;x<array4.length;x++){
strRange4= strRange4 + array4[x] + '</small></span></td></tr><tr><td><span class=instruction><small>'
}
document.write('<table border=1><tr><td><span class=instruction><small>')
document.write (strRange4)
document.write('</small></span></td></tr></table>')
function TEXTAREA1_onclick() {

}

  </script>
    </td>
    <td valign="center" align="right">&nbsp;</td></tr>
  <tr valign="baseline" bgcolor="#cccccc">
    <td valign="center" align="right">(internal) reference ranges (edit here):</td>
    <td><textarea style="FONT-SIZE: 7pt; FONT-FAMILY: Verdana" name="REFRANGE" rows="3" cols="90">Hb;140-180;g/L;M;;Hb;120-160;g/L;F|Lkc;4.0-11.0;E+9/L;;;;;;|Plt;150-400;E+9/L;;;;;;|MCV;80-95;fL;;;;;;|RDW;11.5-14.8;;;;;;;|ERC;4.5-6.5;E+12/L;M;;ERC;3.9-5.6;E+12/L;F|PCV;0.40-0.54;L/L;M;;PCV;0.33-0.47;L/L;F|MCH;27.0-32.0;pg;;;;;;|MCHC;320-360;L/L;;;;;;|NEUT;2.0-7.5;E+9/L;;;;;;|LYMPH;1.5-4.0;E+9/L;;;;;;|MONO;0.2-0.8;E+9/L;;;;;;|EOS;0.04-.4;E+9/L;;;;;;|BASO;0.01-0.1;E+9/L;;;;;;</textarea> 
    </td>
    <td><a onclick="Preview_Table(REFRANGE)" href="javascript:;"></a></td></tr>
  <tr valign="baseline" bgcolor="#cccccc">
    <td valign="center" align="right">(web) conversion factor:</td>
    <td valign="center" align="left">
      <div align="left">
      <asp:DropDownList ID="ddl_REF_CONV_ID" runat="server" />
    </div></td>
    <td valign="center" align="right">&nbsp;</td></tr>
     <!--end of web reference ranges section -->
 
  </tbody>
  
  </table>
</asp:Panel>
<asp:Panel ID="pnlSuccess" runat="server">
<asp:Label ID="lblSuccessMsg" runat="server"></asp:Label>

</asp:Panel>

<asp:Panel ID="pnlEditLabTest" runat="server">

</asp:Panel>

</asp:Content>
